﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="popUpMateriales.aspx.vb" Inherits="Interfaz_popUpMateriales" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link rel="stylesheet" media="screen,projection" type="text/css" href="./css/main.css" />
    <title>Insertar materiales</title>
          
  <script type="text/javascript">
        function ValidNum(e) {
        var tecla = document.all ? tecla = e.keyCode : tecla = e.which;
        return ((tecla > 47 && tecla < 58) || tecla == 46);                             
        }
        
        function OnCurrencyValueKeyUp(input)
        { 
        if(input.value.toString().length == 1 && input.value.toString() == '0') 
        input.value = input.value.replace('0',''); 

        var num = input.value.replace('.','');
        num = input.value.replace(/\,/g,'');
        if((!isNaN(num)|| num=='-') && num != '-0')
        {
        if(num.indexOf('.') > -1)
        {
        num = num.split('.');
        num[0] = num[0].toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1,').split('').reverse().join('').replace(/^[\,]/,'');
        if(num[1].length > 2)
        {
        num[1] = num[1].substring(0,num[1].length-1);
        }
        input.value = num[0]+'.'+num[1]; 
        }
        else
        {
        input.value = num.toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1,').split('').reverse().join('').replace(/^[\,]/,'') };
        }
        else
        {
        input.value = input.value.substring(0,input.value.length-1);
        }
        input.value = input.value.toString().replace(/\$|\ /g,'');
        input.value = input.value.toString().replace('.','');
        input.value = input.value.toString().replace('-,','-');    
}

        function addsimbol(input,op){
        
        if(input.value.charAt(0)!=("$") && input.value.length>0 &&op==1){
        input.value = "$"+input.value.toString();
        }
        if(input.value.charAt(input.value.length-1)!=("%") && input.value.length>0 && op==2){        
        var a=input.value.toString().replace("%","")
        input.value = a+"%";
        }
        }
  </script>
  
  
</head>
<body>
    <form id="form1" runat="server">
    <div>     
         
    </div>
         <table style="width: 100%; background-color: white; border-right: lightblue thin solid; border-top: lightblue thin solid; border-left: lightblue thin solid; border-bottom: lightblue thin solid;">
            <tr>
                <td>
                    <table style="width: 100%; border-bottom: mediumblue thin double; background-color: white">
                        <tr>
                            <td style="width: 100%; text-align: left">
                                <strong>DETALLE MATERIALES</strong></td>
                        </tr>
                    </table >
                                <table style="width: 100%">
                                    <tr>
                                        <td style="width: 210px; text-align: justify">
                                            <strong>Seleccione Proveedor:</strong></td>
                                        <td style="width: 241px; text-align: left">
                                            <asp:DropDownList ID="DropProveedorMat" runat="server" Width="200px">
                                            </asp:DropDownList></td>
                                        <td style="width: 206px; text-align: left">
                                            <asp:Button ID="BtnProvMAt" runat="server" Text="Buscar Item" /></td>
                                        <td style="width: 206px; text-align: left">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 210px; text-align: justify">
                                            <strong>Material espera &nbsp;:</strong></td>
                                        <td style="width: 241px; text-align: left">
                                            <asp:CheckBox ID="CBMateEspera" runat="server" AutoPostBack="True" />&nbsp;<asp:DropDownList ID="DropItemMatEspera" runat="server" Width="200px">
                                            </asp:DropDownList></td>
                                        <td style="width: 82px; text-align: justify">
                                            <strong>Cantidad :</strong></td>
                                        <td>
                                            <asp:TextBox ID="TxTCantidadMat" runat="server" Width="200px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 210px; text-align: justify">
                                            <strong>Material Stock :</strong></td>
                                        <td style="width: 241px; text-align: left">
                                            <asp:CheckBox ID="CBMateStock" runat="server" AutoPostBack="True" />&nbsp;<asp:DropDownList
                                                ID="DropItemMatStock" runat="server" Width="201px">
                                            </asp:DropDownList></td>
                                        <td colspan="2" style="width: 82px; text-align: justify">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 210px; height: 34px; text-align: justify">
                                            <strong>Descripcion :</strong></td>
                                        <td style="width: 241px; height: 34px; text-align: left">
                                            <asp:TextBox ID="TxTDescMat" runat="server" Height="67px" Width="216px" TextMode="MultiLine"></asp:TextBox></td>
                                        <td style="width: 82px; height: 34px; text-align: justify">
                                            <strong>Valor Kg. :</strong></td>
                                        <td style="height: 34px">
                                            <asp:TextBox ID="TxTValorMat" runat="server" Width="200px"></asp:TextBox></td>
                                    </tr>
                                </table>
                </td>
            </tr>
            <tr>
                <td>
                                <asp:Label ID="LabelAvisoMat" runat="server" Width="650px"></asp:Label></td>
            </tr>
            <tr>
                <td>
                                <table style="border-right: blue thin solid; border-top: blue thin solid; border-left: blue thin solid;
                                    width: 100%; border-bottom: blue thin solid; position: static">
                                    <tr>
                                        <td style="text-align: center">
                                            <asp:Button ID="BtnIngresarMat" runat="server" Text="Ingresar" Width="96px" /></td>
                                        <td style="text-align: center">
                                            <asp:Button ID="BtnLimpMat" runat="server" Text="Limpiar Sección" Width="104px" /></td>
                                    </tr>
                                </table>
                </td>
            </tr>
            <tr>
                <td style="text-align: center">
                                <asp:GridView ID="GridMaterial" runat="server" AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%"  >
                                 
                                    <RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" />
                                    <Columns>
                                        <asp:CommandField ShowDeleteButton="True" ButtonType="Image" DeleteImageUrl="~/Interfaz/Imagenes/delete-icon-md35.png" DeleteText="" HeaderText="Eliminar">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:CommandField>
                                        <asp:BoundField DataField="ID" HeaderText="Id">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="ITEM" HeaderText="Item">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="CANTIDAD" HeaderText="Cantidad">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="DESCRIPCION" HeaderText="Descripcion">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="VALORKG" HeaderText="Valor Kg.">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="TOTNETO" HeaderText="Total Neto" >
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                </asp:GridView>
                </td>
            </tr>
        </table>
       
    

    </form>
</body>
</html>
